'use strict';

/**
 * @class sf.b2c.mall.framework.view.controller
 * @description view.controller基类
 * @param  {Object} can
 * @param  {Object} _   underscore
 * @return {can.Map}
 */
define(['can', 'underscore'], function (can, _) {

  return can.Control.extend({

    /**
     * @function sf.b2c.mall.framework.view.controller.draw
     * @description view的绘制
     * @param  {String}           template  模版名称
     * @param  {Map}              data      数据
     * @param  {Mustache.Helper}  helper
     */
    draw: function (template, data, helper) {
      this.element.html(can.view(template, data, helper || {}));
    },

    /**
     * @function sf.b2c.mall.framework.view.controller.render
     * @description view的第1层渲染
     */
    render: function () {
      throw('使用前必须被复写');
    },

    /**
     * @function sf.b2c.mall.framework.view.controller.supplement
     * @description view的第2层渲染
     */
    supplement: function () {
      throw('使用前必须被复写');
    }

  });

});